<?php
/**
 * Created by PhpStorm.
 * Author: ExtraXue
 * Date: 2018/5/8
 * Description:
 */

require_once ('pdo.php');

session_start();
$uid=$_GET['uid'];
$sqlDeptCheck="select * from dept_info a where a.uid='{$uid}'";
$rsDeptCheck=$pdo->query($sqlDeptCheck);
$resultDeptCheck=$rsDeptCheck->fetch(PDO::FETCH_ASSOC);

if($resultDeptCheck){
    $sqlDeleteDept="delete from dept_info a where a.uid='{$uid}'";
    $pdo->exec($sqlDeleteDept);
    echo "<script>alert('删除成功！');history.back()</script>";
}else{
    echo "<script>alert('删除失败！');history.back()</script>";
}
